package com.swpu.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.awt.*;
import java.util.Random;

@RestController
@RequestMapping(value = "/myapp")
public class JavaSpringXiayuhaoController {
    @GetMapping(value = ("test"))
    public String test(@RequestParam(value = "name")String name){
        var temp="";
        Random r = new Random();
        var ran =r.nextInt(3)+1;
        if(ran == 1){
            temp=name+"是der娃";
        }else if (ran == 2){
            temp=name+"是海王";
        }else{
            temp=name+"是聪明蛋";
        }
        return temp;
    }
}
